package com.project.controller;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.project.bean.SellOrderBean;
import com.project.service.ISellOrderService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.time.LocalDate;
@RestController
@RequestMapping("sellOrder")
@Api(tags = "销售信息")
public class SellOrderController {
    @Autowired
    private ISellOrderService sellOrderService;
    @ApiOperation(value = "分页查询销售信息")
    @RequestMapping("findByItem")
    public IPage<SellOrderBean> findByItem(Integer pageNO, String customer,
                                           LocalDate startDate, LocalDate endDate){
        return sellOrderService.findByItem(pageNO, customer, startDate, endDate);
    }
    @ApiOperation(value = "根据销售信息id查询销售信息，并查询销售详细信息集合")
    @RequestMapping("findById")
    public SellOrderBean findById(Integer sellOrderId){
        return sellOrderService.findById(sellOrderId);
    }
}
